﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GroupKPIForm.aspx.cs" Inherits="FBKPI.Forms.GroupKPIForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btn_save").click(function () {
                var param = "?";
                var isActive = 'false';

                $('#form1 td input:checked').each(function () {
                    var $cb = $(this);
                    if ($cb.attr('id') == 'chk_active') {
                        isActive = 'true';
                    }
                });

                param = param + "action=save";
                param = param + "&ID=" + $("#hfId").val();
                param = param + "&Description=" + $("#txt_description").val();
                param = param + "&isActive=" + isActive;
                param = param + "&CurrUser=" + $("#txt_user").val();
                param = param + "&Sequence="+$("#txtSequence").val();
                ProcessRequest("GroupKPIHandler.ashx" + param, "#divdetail", "#GroupKPITable");
                return false;
            });


            $("#btn_delete").click(function () {
                //                if (confirm('Are you sure to delete this record?')) {
                //                    var param = "?";
                //                    param = param + "action=delete";
                //                    param = param + "&ID=" + $("#txt_id").val();
                //                    param = param + "&CurrUser=" + $("#txt_user").val();
                //                    ProcessRequest("GroupKPIHandler.ashx" + param, "#divdetail", "#GroupKPITable");
                //                    return false;
                //                }

                $.msgBox.confirm("Benar data akan dihapus ?", function () {
                    var param = "?";
                    param = param + "action=delete";
                    param = param + "&ID=" + $("#txt_id").val();
                    param = param + "&CurrUser=" + $("#txt_user").val();
                    ProcessRequest("GroupKPIHandler.ashx" + param, "#divdetail", "#GroupKPITable");
                    return false;
                }, false);
                return false;
            });

            $("#btn_close").click(function () {
                parent.$("#divdetail").dialog("close");
                return false;
            });

        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="groupkpiformarea" class="ui-widget-content padding5px ui-corner-all">
        <table class="dialogTable">
            <tr runat="server" visible="false">
                <td width="140px">
                    ID
                </td>
                <td class="Separator">
                    :
                </td>
                <td>
                    <asp:TextBox ID="txt_id" runat="server" ReadOnly="true"></asp:TextBox>
                </td>
            </tr>
           
            <tr>
                <td>
                    Description
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txt_description" runat="server" Width="400" class="mandatory"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    is Active
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:CheckBox ID="chk_active" Checked="true" runat="server" />
                </td>
            </tr>
             <tr id="Tr1" runat="server" visible="true">
                <td>
                    Sequence
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtSequence" Text="0" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <%--    <div id="AuditInformation" class="ui-widget-content padding5px ui-corner-all">
            <b style="margin-left:5px">Audit Information</b>
            <table class="dialogTable">
                <tr>
                    <td width="140px">Last Modified Date</td>
                    <td class="Separator">:</td>
                    <td><asp:TextBox ID="txt_lastmodifieddate" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Last Modified By</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_lastmodifiedby" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Create Date</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_createdate" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Create By</td>
                    <td>:</td>
                    <td><asp:TextBox ID="txt_createby" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
            </table>
        </div>--%>
    <br />
    <button id="btn_save" class="button save">
        Save
    </button>
      <button id="btn_close" class="button close">
        Close
    </button>
    <%--  <button id="btn_delete" class="ui-button ui-corner-all ui-button ui-state-default ui-button-text-icon-primary" runat="server">
            <span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span>
            <label class="ui-button-text">
                Delete</label>
        </button>--%>
        <asp:HiddenField ID="hfId" runat="server" Value="0" />
    </form>
</body>
</html>
